mudbox::ViewPortFilter Class Reference

#include <viewport.h>

Inheritance diagram for mudbox::ViewPortFilter:

Inheritance graph
[legend]
List of all members.

Detailed Description

ViewPortFilters are post-processes that are applied to the rendered scene before display.

Mudbox first renders the meshes in the scene, then goes through its list of ViewPortFilters. Any filters with visibility turned on are applied to the resulting image, yielding the new image that is displayed. This base class ViewPortFilter does nothing; you must derive new filters from it.


Public Types

typedef int  RequirementValue
  The RequirementValue typedef is used to tell Mudbox what information needs to be calculated at render time so that this ViewPortFilter can work properly.
enum   {
  eNone = 0, eColor = 1, eHDR = 2, eDepth24 = 4,
  eNormal16 = 16, ePosition32 = 32, eNormalDepth16 = 128, eLinearDepth = 512,
  eFaceNormal = 1024
}

Public Member Functions

virtual const mudbox::ClassDesc RuntimeClass (void) const
virtual void  Initialize (void)
  This is called after construction to initialize internal variables.
virtual RequirementValue  Requirement (void) const
  Returns a value that indicates what information is required by the ViewPortFilter.
virtual void  Process (ViewPortState &sState)
  Process the Mudbox view through the ViewPortFilter.
virtual float  Transparency (void) const
  This method is not used in ViewPortFilters.
virtual void  SetTransparency (float fTransparency)
  This method is not used in ViewPortFilters.
virtual Layer Children (void) const
  This method is not used in ViewPortFilters.
virtual Layer Next (void) const
  This method is not used in ViewPortFilters.
virtual Layer Prev (void) const
  This method is not used in ViewPortFilters.
virtual class LayerContainer Container (void) const
  This method is not used in ViewPortFilters.
void  SetVisible (bool bVisible)
  Turns the ViewPortFilter on and off.
virtual void  LockCalibration (bool bLock)
  This method locks any calibration the ViewPortFilter does.
bool  CalibrationLocked (void)
  Returns true if the ViewPortFilter calibration is locked.

Static Public Member Functions

const mudbox::ClassDesc StaticClass (void)
mudbox::Node CreateInstances (unsigned int iCount=1)

Public Attributes

ViewPort m_pViewPort
  A pointer to the Viewport containing this ViewPortFilter.

Protected Attributes

bool  m_bCalibrationLocked

Member Typedef Documentation

typedef int mudbox::ViewPortFilter::RequirementValue
 

The RequirementValue typedef is used to tell Mudbox what information needs to be calculated at render time so that this ViewPortFilter can work properly.

The elements in this list can be combined with a bitwise or (|) operator. This is used in the Requirements method.


Member Enumeration Documentation

anonymous enum
 
Enumeration values:
eNone 
eColor 
eHDR 
eDepth24 
eNormal16 
ePosition32 
eNormalDepth16 
eLinearDepth 
eFaceNormal 
00051     {
00052         eNone = 0,
00053         eColor = 1,
00054         eHDR = 2,
00055         eDepth24 = 4,
00056 //      ePosition16 = 8, // not implemented
00057         eNormal16 = 16,
00058         ePosition32 = 32,
00059 //      eNormal32 = 64, // not implemented
00060         eNormalDepth16 = 128,
00061 //      eNormalDepth32 = 256, // not implemented
00062         eLinearDepth = 512,
00063         eFaceNormal = 1024,
00064     };

Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::ViewPortFilter::RuntimeClass void   )  const [inline, virtual]
 

Reimplemented from mudbox::Layer.

00043 :

const mudbox::ClassDesc* mudbox::ViewPortFilter::StaticClass void   )  [static]
 

Reimplemented from mudbox::Layer.

mudbox::Node* mudbox::ViewPortFilter::CreateInstances unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::Layer.

virtual void mudbox::ViewPortFilter::Initialize void   )  [virtual]
 

This is called after construction to initialize internal variables.

Reimplemented from mudbox::Node.

virtual RequirementValue mudbox::ViewPortFilter::Requirement void   )  const [virtual]
 

Returns a value that indicates what information is required by the ViewPortFilter.

When you create your own ViewPortFilter, you must override this method. Mudbox only calculates things like depth maps or normal maps when requested, so you must figure out what information is needed as input to your viewport filter, and have this function return the appropriate flags.

virtual void mudbox::ViewPortFilter::Process ViewPortState sState  )  [virtual]
 

Process the Mudbox view through the ViewPortFilter.

This method does the actual work of filtering the viewport. Derived ViewPortFilters must override it. It takes the information provided in the ViewPortState that is passed in, and puts the resulting (filtered) image in the m_pColor texture of that object. This method must be overridden by derived classes.

Parameters:
sState  [in|out] The textures used by this filter, and the result
virtual float mudbox::ViewPortFilter::Transparency void   )  const [virtual]
 

This method is not used in ViewPortFilters.

Reimplemented from mudbox::Layer.

virtual void mudbox::ViewPortFilter::SetTransparency float  fTransparency  )  [virtual]
 

This method is not used in ViewPortFilters.

Reimplemented from mudbox::Layer.

virtual Layer* mudbox::ViewPortFilter::Children void   )  const [virtual]
 

This method is not used in ViewPortFilters.

Reimplemented from mudbox::Layer.

virtual Layer* mudbox::ViewPortFilter::Next void   )  const [virtual]
 

This method is not used in ViewPortFilters.

Reimplemented from mudbox::Layer.

virtual Layer* mudbox::ViewPortFilter::Prev void   )  const [virtual]
 

This method is not used in ViewPortFilters.

Reimplemented from mudbox::Layer.

virtual class LayerContainer* mudbox::ViewPortFilter::Container void   )  const [virtual]
 

This method is not used in ViewPortFilters.

Reimplemented from mudbox::Layer.

void mudbox::ViewPortFilter::SetVisible bool  bVisible  )  [virtual]
 

Turns the ViewPortFilter on and off.

Parameters:
bVisible  [in] Set this true to make the filter visible, and false to hide it.

Reimplemented from mudbox::TreeNode.

virtual void mudbox::ViewPortFilter::LockCalibration bool  bLock  )  [virtual]
 

This method locks any calibration the ViewPortFilter does.

Some kinds of ViewPortFilters do a calibration step as part of the process. For example, all the values produced may be normalized to the range of values currently displayed. This can be a problem when you need to generate multiple images where the calibration must be the same (say, to make a large tiled image, or an animation). Locking calibration tells the ViewPortFilter to leave its calibration values at the current level, rather than recalculating per-frame.

Derived ViewPortFilters probably do not need to override this method, but they should pay attention to the flag. If you do need to override the method, ensure the derived method calls the base method so that the flag will be set properly.

Parameters:
bLock  [in] Set this true to lock calibration, and false to unlock it
bool mudbox::ViewPortFilter::CalibrationLocked void   ) 
 

Returns true if the ViewPortFilter calibration is locked.


Member Data Documentation

class ViewPort* mudbox::ViewPortFilter::m_pViewPort
 

A pointer to the Viewport containing this ViewPortFilter.

bool mudbox::ViewPortFilter::m_bCalibrationLocked [protected]
 

mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter
mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter mudbox::ViewPortFilter